﻿using System.Web.Security;

namespace NMA.Web.Areas.Admin.Models.Service.Impl
{
    using NMA.Infrastructure.DBC;

    public class FormsAuthenticationService : IFormsAuthenticationService
    {
        public void SignIn(string userName, bool createPersistentCookie)
        {
            Check.Assert(string.IsNullOrEmpty(userName) != true, "Username is null or empty");

            FormsAuthentication.SetAuthCookie(userName, createPersistentCookie);
        }

        public void SignOut()
        {
            FormsAuthentication.SignOut();
        }
    }
}